//
//  SHHomeModelView.m
//  JiFengDaRen
//
//  Created by SH_iOS on 2017/6/6.
//  Copyright © 2017年 SH_iOS. All rights reserved.
//

#pragma mark - 首页数据模型
#import "HomeNoticeModel.h"//首页最新通知模型

#pragma mark - 首页网络请求管理工具类
#import "SHHomeModelView.h"

@implementation SHHomeModelView





#pragma mark - 我是瀚付 -- 银联支付
#pragma  mark -- 收款中心获取可用的银联支付方式 cash_type　：(0, "瀚银支付"),(1, "杉奇支付"),(2, "上福支付"),

+ (void)getPayChoiceCashTypeSuccess:(void(^)(NSInteger cashType))success{
    
    UIViewController *vc =  [SHHelper currentViewController];
    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    [MyDataService requestAFURL: @"/pay/choice_cash_type" httpMethod:@"GET" params:nil data:nil complection:^(id result) {
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        
        /*
         data": {
         "status": true,　# 通道状态
         "trad_fee": 0.0049,　# 交易费率
         "withdraw_rate": 3,　# 单笔交易手续费
         "cash_name": "山奇支付",　# 通道名称
         "cash_type": 1 # 支付类型
         },
         "success": true,
         
         */
        if ([result[@"success"] isEqualToNumber:@(1)]) {
            
            if([result[@"data"] count] == 0){
                
                [vc.view makeToast:@"银联支付系统维护中" duration:2 position:@"center"];
                
            }else{
                
                if ([result[@"data"][@"status"] boolValue]) {
                    
                    NSInteger cashType = [result[@"data"][@"cash_type"] integerValue];
                    success(cashType);
                }
            }
            
            
        }else{
            [vc.view makeToast:result[@"data"] duration:2 position:@"center"];
        }
    } failure:^(id erro) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
    }];
    
    
}

#pragma mark - 荣邦支付
#pragma mark - 荣邦支付查询商户注册状态
+ (void)rongbangPaymentGetApplyViewSuccess:(void(^)(int  status))success  {
    
    [MyDataService requestNoRSAAFURL:RONGBANG_PAYMENT_MERCHANTS_GET_APPLY httpMethod:@"GET" params:nil data:nil complection:^(id result) {
        
        if ([result[@"success"] boolValue]) {
            
            int status = [result[@"data"][@"status"] intValue];
            
            success(status);
        }
        
        
    } failure:^(id erro) {
        
        
    }];
    
    
}


#pragma mark -  荣邦支付上传实名照片
+ (void)rongbangPaymentUploadImageFileType:(NSString *)fileType suffix:(NSString *)suffix content:(NSString *)content success:(void(^)(id  result))success{
    
    NSDictionary *params = @{@"file_type":fileType,@"suffix":suffix,@"img_url":content};
    [MyDataService requestAFURL:RONGBANG_PAYMENT_IMAGE_UPLOAD_VIEW httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        success(result);
        
    } failure:^(id erro) {
        
    }];
}


#pragma mark -- 荣邦支付商户注册
+ (void)rongbangPaymentMerchantsApplyBankId:(NSString *)bankId{
    
    if (!bankId) {
        
        SHLog(@"RONGBANG_PAYMENT_IMAGE_UPLOAD_VIEW : 银行卡id为空");
        return;
    }
    NSDictionary *params = @{@"bank_id":bankId};
    [MyDataService requestNoRSAAFURL:RONGBANG_PAYMENT_MERCHANTS_APPLY httpMethod:@"GET" params:params data:nil complection:^(id result) {
        
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"centet"];
        }
        
    } failure:^(id erro) {
        
        
    }];
}

#pragma mark -- 荣邦支付收款
+ (void)rongbangPaymentOrderPay:(NSString *)amount success:(void(^)(id result))success;
{
    if (!amount) {
        
        return;
    }
    int intAmount =  [amount intValue];
    NSDictionary *params = @{@"amount":@(intAmount)};
    UIViewController *vc =  [SHHelper currentViewController];
    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    
    [MyDataService requestAFURL:RONGBANG_PAYMENT_ORDER_APPLY httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        if ([result[@"success"] boolValue]) {
            
            success(result);
        }else{
            [vc.view  makeToast:result[@"data"] duration:2.f position:@"center"];
        }
        
    } failure:^(id erro) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        
    }];
    
    
}


#pragma mark - 瀚银支付
#pragma mark -- 瀚银支付查询商户注册状态
+ (void)hanyinInGetApplyViewSuccess:(void(^)(int  status))success  {
    
    [MyDataService requestNoRSAAFURL:HANYIN_PAYMENT_QUERY
                          httpMethod:@"GET" params:nil data:nil complection:^(id result) {
                              
                              if ([result[@"success"] boolValue]) {
                                  
                                  
                                  
                                  success(1);
                                  
                              }else{
                                  
                                  success(0);
                              }
                              
                              
                          } failure:^(id erro) {
                              
                              
                          }];
    
    
}

#pragma mark -- 瀚银支付商户注册
+ (void)hanyinInNetBankId:(NSString *)bankId{
    
    if (!bankId) {
        
        SHLog(@"RONGBANG_PAYMENT_IMAGE_UPLOAD_VIEW : 银行卡id为空");
        return;
    }
    NSDictionary *params = @{@"bank_id":@([bankId intValue])};
    [MyDataService requestAFURL:HANYIN_PAYMENT_IN_NET httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
}

#pragma mark -- 瀚银支付收款
+ (void)hanyinPayDataBankId:(NSString *)bankId
                     amount:(NSString *)amount
                    success:(void(^)(id result))success
{
    if (!amount) {
        
        return;
    }
    int intAmount =  [amount intValue];
    NSDictionary *params = @{@"bank_id":@([bankId intValue]),@"amount":@(intAmount)};
    UIViewController *vc =  [SHHelper currentViewController];
    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    
    [MyDataService requestAFURL:HANYIN_PAYMENT_PAY_DATA httpMethod:@"GET" params:params data:nil complection:^(id result) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        if ([result[@"success"] boolValue]) {
            
            success(result);
        }else{
            
            [vc.view makeToast:result[@"data"] duration:2.f position:@"center"];
        }
        
    } failure:^(id erro) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        
    }];
    
    
}

#pragma mark -  上福支付
#pragma mark -- 上福支付判断用户是否注册

+ (void)shangfuInGetApplyViewPassageway:(NSString *)passageway success:(void(^)(int  status))success  {
    
    if (!passageway) {
        
        return;
    }
    NSDictionary *params = @{@"passageway":passageway};
    [MyDataService requestNoRSAAFURL:SHANGFU_PAYMENT_QUERY httpMethod:@"GET" params:params data:nil complection:^(id result) {
        if ([result[@"success"] boolValue]) {
            
            success(1);
            
        }else{
            
            success(0);
        }
    } failure:^(id erro) {
        
    }];
    
}
+ (void)shangfuInGetApplyViewSuccess:(void(^)(int  status))success  {
    
    [MyDataService requestNoRSAAFURL:SHANGFU_PAYMENT_QUERY httpMethod:@"GET" params:nil data:nil complection:^(id result) {
        if ([result[@"success"] boolValue]) {
            
            success(1);
            
        }else{
            
            success(0);
        }
    } failure:^(id erro) {
        
    }];
    
}

+ (void)shangfuInNetBankId:(NSString *)bankId passageway:(NSString *)passageway{
    if (!bankId) {
        
        SHLog(@"SHANGFU_PAYMENT_IMAGE_UPLOAD_VIEW : 银行卡id为空");
        return;
    }
    
    if (!passageway) {
        
        SHLog(@"SHANGFU_PAYMENT_IMAGE_UPLOAD_VIEW : passageway为空");
        return;
    }
    
    NSDictionary *params = @{@"credit_bank_id":bankId,@"passageway":passageway};
    [MyDataService requestAFURL:SHANGFU_PAYMENT_IN_NET httpMethod:@"POST" params:params data:nil complection:^(id result) {
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
        }
    } failure:^(id erro) {
        
    }];
    
    
}
#pragma mark -- 上福支付商户注册
+ (void)shangfuInNetBankId:(NSString *)bankId{
    
    if (!bankId) {
        
        SHLog(@"SHANGFU_PAYMENT_IMAGE_UPLOAD_VIEW : 银行卡id为空");
        return;
    }
    
    NSDictionary *params = @{@"credit_bank_id":bankId};
    [MyDataService requestAFURL:SHANGFU_PAYMENT_IN_NET httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
        }
    } failure:^(id erro) {
        
    }];
    
}


#pragma mark - 杉德支付 检查用户是否能使用杉德支付
+ (void)checkSdPayMethodByUserSuccess:(void(^)(NSInteger status))success{
    
    NSString * statusStr = [Tool objectForKey:@"isSdUser"];
    if (statusStr) {
        success([statusStr boolValue]);
        return;
    }
    //查询用户是否显示杉德支付
    [MyDataService requestNoRSAAFURL:@"/data/api/check_pay_method_by_user" httpMethod:@"GET" params:nil data:nil complection:^(id result) {
        SHLog(@"======%@",result);
        if ([result[@"success"] boolValue]) {
            if ([result[@"data"][@"status"] boolValue]) {
                
                [Tool setObject:@"1" forKey:@"isSdUser"];
                success(1);
            }else{
                [Tool setObject:@"0" forKey:@"isSdUser"];
                
                success(0);
                
                
                
            }
        }
    } failure:^(id erro) {
        
    }];
    
    
}



#pragma mark - 合刷支付
#pragma mark --合刷支付查询商户注册状态
+ (void)heShuaInGetApplyViewSuccess:(void(^)(int  status))success{
    
    [MyDataService requestNoRSAAFURL:HESHUA_PAYMEN_MERCHANT_QUERY
                          httpMethod:@"POST" params:nil data:nil complection:^(id result) {
                              SHLog(@"HESHUA_PAYMEN_MERCHANT_QUERY%@",result);
                              if ([result[@"success"] boolValue]) {
                                  
                                  
                                  
                                  success(1);
                                  
                              }else{
                                  
                                  success(0);
                              }
                              
                              
                          } failure:^(id erro) {
                              
                              
                          }];
    
    
}



#pragma mark -- 合刷支付商户注册
+ (void)heShuaInNetBankId:(NSString *)bankId{
    
    if (!bankId) {
        
        SHLog(@"HESHUA_PAYMEN_MERCHANT_REGISTER : 银行卡id为空");
        return;
    }
    NSDictionary *params = @{@"bank_card_id":@([bankId intValue])};
    [MyDataService requestAFURL:HESHUA_PAYMEN_MERCHANT_REGISTER httpMethod:@"POST" params:params data:nil complection:^(id result) {
        SHLog(@"HESHUA_PAYMEN_MERCHANT_REGISTER%@",result);
        
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
}

#pragma mark -- 合刷支付支付接口
+ (void)heShuaInPayAmount:(NSString *)amount
               bankCardNo:(NSString *)bankCardNo{
    
    
    if (!amount) {
        
        SHLog(@"HESHUA_PAYMEN_MERCHANT_REGISTER : 金额为空");
        return;
    }
    
    if (!bankCardNo){
        
        SHLog(@"HESHUA_PAYMEN_MERCHANT_REGISTER : 银行卡卡号为空");
        return;
    }
    
    
    NSDictionary *params = @{@"amount":amount,@"bankCardNo":bankCardNo};
    [MyDataService requestAFURL:HESHUA_PAYMEN_QUICKPAY_RREORDER httpMethod:@"POST" params:params data:nil complection:^(id result) {
        SHLog(@"HESHUA_PAYMEN_QUICKPAY_RREORDER%@",result);
        
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
    
    
}


#pragma mark - 银商支付
#pragma mark -- 银商支付查询商户注册状态
+ (void)yingshangInGetApplyViewSuccess:(void(^)(int  status))success{

    [MyDataService requestNoRSAAFURL:KYINGSHANG_CUSTOMER_QUERY httpMethod:@"GET" params:nil data:nil complection:^(id result) {
        SHLog(@"KYINGSHANG_CUSTOMER_QUERY%@",result);
        if ([result[@"success"] boolValue]) {
            success(1);
        }else{
            success(0);
        }
        
    } failure:^(id erro) {
        
    }];
   
}



#pragma mark - 银商支付商户注册
+ (void)yingshangInNetBankId:(NSString *)bankId{
    
    if (!bankId) {
        
        SHLog(@"HESHUA_PAYMEN_MERCHANT_REGISTER : 银行卡id为空");
        return;
    }
    
    //银商  KYINGSHANG_CUSTOMER_REGISTER
    //    NSDictionary *params = @{@"bank_card_id":@([bankId intValue])};
    
    //上福 KSHANGFUPAY_REGISTER
    NSDictionary *params = @{@"bank_card_id":@([bankId intValue])};
    
    [MyDataService requestAFURL:KYINGSHANG_CUSTOMER_REGISTER httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        SHLog(@"KYINGSHANG_CUSTOMER_REGISTER%@",result);
        
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
}

#pragma mark - 银商微信收款
+ (void)yingshangWechatPayCashAmount:(NSString *)amount
                             success:(void(^)(id  result))success{
    
    UIViewController *vc =  [SHHelper currentViewController];
    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    NSDictionary *params = @{@"amount":amount};
    [MyDataService requestAFURL: KYINGSHANG_WECHATPAY_QUICKPAY httpMethod:@"POST" params:params data:nil complection:^(id result) {
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        if ([result[@"success"] isEqualToNumber:@(1)]) {
            
            success(result);
            
        }else{
            [vc.view makeToast:result[@"data"] duration:2 position:@"center"];
        }
    } failure:^(id erro) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
    }];
    
    
    
    
}

#pragma mark - 银商支付宝收款
+ (void)yingshangAliPayCashAmount:(NSString *)amount
                          success:(void(^)(id  result))success{
    
    UIViewController *vc =  [SHHelper currentViewController];
    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    NSDictionary *params = @{@"amount":amount};
    //KSHANGFUPAY_ALIPAY_SCANNINGPAY
    [MyDataService requestAFURL: KYINGHSANG_ALIPAY_QUICKPAY httpMethod:@"POST" params:params data:nil complection:^(id result) {
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        if ([result[@"success"] isEqualToNumber:@(1)]) {
            
            success(result);
            
        }else{
            [vc.view makeToast:result[@"data"] duration:2 position:@"center"];
        }
    } failure:^(id erro) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
    }];
    
    
    
    
}
#pragma mark - 银商刷卡 修改收款卡
+ (void)yingshangChangeSettleBankCardWithBankCardId:(NSString *)bankCardId{
    
    
    UIViewController *vc =  [SHHelper currentViewController];
    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    if (!bankCardId) {
        SHLog(@"银行卡Id为空");
        return;
    }
    NSDictionary *params = @{@"bank_card_id":bankCardId};
    [MyDataService requestAFURL: KYINGSHANG_CHANGE_SETTLE_CARD httpMethod:@"POST" params:params data:nil complection:^(id result) {
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        if ([result[@"success"] isEqualToNumber:@(1)]) {
            
            [vc.view makeToast:@"修改收款卡成功！" duration:2 position:@"center"];
            
        }else{
            [vc.view makeToast:result[@"data"] duration:2 position:@"center"];
        }
    } failure:^(id erro) {
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
    }];
    
    
}







#pragma mark - 福汇通  小额银联支付
#pragma mark -- 福汇通 小额银联支付注册查询接口 reg_type：

+ (void)fuhuitongGetApplyViewRegType:(NSString *)regType
                             Success:(void(^)(int  status))success{
    
    if (!regType) {
        
        SHLog(@"FUHUITONG_PAYMENT_IMAGE_UPLOAD_VIEW : 进件类型为空");
        return;
    }
    NSDictionary *params = @{@"reg_type":regType};
    
    [MyDataService requestNoRSAAFURL:KFUIHUITONGPAY_REGISTER_QUERY httpMethod:@"GET" params:params data:nil complection:^(id result) {
        if ([result[@"success"] boolValue]) {
            
            success(1);
            
        }else{
            
            success(0);
        }
    } failure:^(id erro) {
        
    }];
    
}

#pragma mark -- 福汇通 小额银联支付注册接口
+ (void)fuhuitognPostNetbankCardCode:(NSString *)bankCardCode
                             regType:(NSString *)regType{
    
    if (!bankCardCode) {
        
        SHLog(@"FUHUITONG_PAYMENT_IMAGE_UPLOAD_VIEW : 银行卡卡号为空");
        return;
    }
    if (!regType) {
        
        SHLog(@"FUHUITONG_PAYMENT_IMAGE_UPLOAD_VIEW : 进件类型为空");
        return;
    }
    NSDictionary *params = @{@"credit_bank_code":bankCardCode,@"reg_type":regType};
    [MyDataService requestAFURL:KFUIHUITONGPAY_REGISTER httpMethod:@"POST" params:params data:nil complection:^(id result) {
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
        }
    } failure:^(id erro) {
        
    }];
    
}







#pragma mark - 东孝银联快捷支付
#pragma mark -- 东孝银联支付查询商户进件
+ (void)dxInGetApplyViewSuccess:(void(^)(int  status))success{
    
    [MyDataService requestNoRSAAFURL:KDXPAY_REGISTER
                          httpMethod:@"GET"
                              params:nil
                                data:nil
                         complection:^(id result) {
                             SHLog(@"KDXPAY_REGISTER%@",result);
                             if ([result[@"success"] boolValue]) {
                                 
                                 
                                 
                                 success(1);
                                 
                             }else{
                                 
                                 success(0);
                             }
                             
                             
                         } failure:^(id erro) {
                             
                             
                         }];
    
    
}



#pragma mark -- 东孝银联支付商户进件
+ (void)dxInNetWithdrawBankId:(NSString *)withdrawBankId{
    
    if (!withdrawBankId) {
        
        SHLog(@"KDXPAY_REGISTER : 银行卡id为空");
        return;
    }
    
    
    
    NSDictionary *params = @{@"withdraw_bank_id":withdrawBankId};
    
    [MyDataService requestAFURL:KDXPAY_REGISTER httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        SHLog(@"KDXPAY_REGISTER%@",result);
        
        if ([result[@"success"] boolValue]) {
            [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
}

#pragma mark -- 东孝银联支付查询商户付款卡签约
+ (void)dxQuerySigningtWithPayBankId:(NSString *)payBankId Success:(void(^)(int  status))success{
    
    if (!payBankId) {
        
        SHLog(@"KDXPAY_REGISTER : 付款银行卡id为空");
        return;
    }
    
    NSDictionary *params = @{@"pay_bank_id":payBankId};
    
    [MyDataService requestNoRSAAFURL:KDXPAY_SIGNING
                          httpMethod:@"GET" params:params data:nil complection:^(id result) {
                              SHLog(@"KDXPAY_SIGNING%@",result);
                              if ([result[@"success"] boolValue]) {
                                  
                                  
                                  
                                  success(1);
                                  
                              }else{
                                  
                                  success(0);
                              }
                              
                              
                          } failure:^(id erro) {
                              
                              
                          }];
    
    
}



#pragma mark -- 东孝银联支付商户付款卡签约
+ (void)dxSigningPageInInNetPayBankId:(NSString *)payBankId Success:(void(^)(NSString * signingPageUrl))success{
    
    if (!payBankId) {
        
        SHLog(@"KDXPAY_REGISTER : 付款银行卡id为空");
        return;
    }
    
    
    
    NSDictionary *params = @{@"pay_bank_id":payBankId};
    
    [MyDataService requestNoRSAAFURL:KDXPAY_SIGNING_PAGE httpMethod:@"GET" params:params data:nil complection:^(id result) {
        
        SHLog(@"KDXPAY_REGISTER%@",result);
        
        if ([result[@"success"] boolValue]) {
            
            success(result[@"data"][@"url"]);
            
        }else{
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
}


#pragma mark -

#pragma mark -- 东孝银联支付商户付款卡签约
+ (void)psbAuthName:(NSString *)name idNo:(NSString *)idNo authImg:(NSString *)authImg Success:(void(^)(BOOL suceesss))success{
    
    if (!name) {
        
        SHLog(@"name为空");
        return;
    }
    if (!idNo) {
        
        SHLog(@"idNo为空");
        return;
    }
    if (!authImg) {
        
        SHLog(@"idNo为空");
        return;
    }
    //auth_img: 认证图片url地址
    //id_no: 身份证号码
    //name: 姓名
    
    
    
    NSDictionary *params = @{
                             @"name":name,
                             @"id_no":idNo,
                             @"auth_img":authImg
                             };
    
    [MyDataService requestAFURL:KPSB_AUTH_NOTIFY_SUCCESS httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        SHLog(@"/psb_auth/notify/api/v1/success%@",result);
        
        if ([result[@"success"] boolValue]) {
            
            success(1);
            
        }else{
            
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
}



#pragma mark - 易宝支付
#pragma mark -- 易宝银联支付查询商户注册状态
+ (void)ybInGetApplyViewSuccess:(void(^)(int  status))success{
    
    [MyDataService requestNoRSAAFURL:KYBPAY_REGISTER_QUERY
                          httpMethod:@"GET"
                              params:nil
                                data:nil
                         complection:^(id result) {
                             SHLog(@"KYBPAY_REGISTER_QUERY%@",result);
                             if ([result[@"success"] boolValue]) {
                              //status 0 未注册，　1 等待审核　2 审核成功　3 审核失败
                                int  status = [result[@"data"][@"status"] intValue];
                                 
                                 success(status);
                                
                                 
                                 
                             }
     
                         } failure:^(id erro) {
                             
                             
                         }];
    
    
}



#pragma mark -- yb银联支付商户注册
+ (void)ybInNetWithdrawBankId:(NSString *)bankId{
    
    if (!bankId) {
        
        SHLog(@"KYBPAY_REGISTER : 银行卡id为空");
        return;
    }
    
    
    
    NSDictionary *params = @{@"bank_id":bankId};
    
    [MyDataService requestAFURL:KYBPAY_REGISTER httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        SHLog(@"KYBPAY_REGISTER%@",result);
        
        if ([result[@"success"] boolValue]) {
            dispatch_async(dispatch_get_main_queue(), ^{//在主线程刷新UI
                
                
                [[SHHelper currentViewController].view makeToast:@"商户入网成功,请输入收款金额立即支付。" duration:2.f position:@"center"];

                
                
            });
            
            
        }else{
            
            [[SHHelper currentViewController].view makeToast:result[@"data"] duration:2.f position:@"center"];
            
        }
        
    } failure:^(id erro) {
        
        
    }];
}

#pragma  mark -用户查询信息完善状态
+ (void)userQueryAuthBankInfoWithBankCardId:(NSString *)bankCardId complection:(void(^)(BOOL authStatus,BOOL bankStatus))complection{
    
    NSDictionary *params = @{
                             @"bank_id":bankCardId
                             };
    [MyDataService requestNoRSAAFURL:@"/data/api/check_auth_bank_info"
                          httpMethod:@"GET" params:params data:nil complection:^(id result) {
                              
                              if ([result[@"success"] boolValue]) {
                                  BOOL authStatus = [result[@"data"][@"auth_status"] boolValue];
                                  BOOL bankStatus = [result[@"data"][@"bank_status"] boolValue];
                                  complection(authStatus,bankStatus);
                              }
                              
                          } failure:^(id erro) {
                              
                          }];
    
}
#pragma mark - 我是瀚付银联统一收款接口
+ (void)myhanPayDataPaymentType:(NSInteger)paymentType
                         bankId:(NSString *)bankId
                         amount:(NSString *)amount
                        success:(void(^)(NSString *postUrl,NSDictionary *postData))success

{
    
    if (!bankId) {
        
        return;
    }
    if (!amount) {
        
        return;
    }


    NSDictionary *params =
       @{
         @"bank_id":bankId,
         @"amount":amount,
         @"cash_type":@(paymentType),
        };
    UIViewController *vc =  [SHHelper currentViewController];
    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    
    [MyDataService requestAFURL:KMYHANPAY_DO_PAY httpMethod:@"POST" params:params data:nil complection:^(id result) {
        
        SHLog(@"我是瀚付统一支付 --- %@",result);
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        if ([result[@"success"] boolValue]) {

            NSString *postUrl = result[@"data"][@"post_url"];
            NSDictionary *postData = result[@"data"][@"dict_data"];

            success(postUrl,postData);
            
        }else{
            
            [vc.view makeToast:result[@"data"] duration:2.f position:@"center"];
        }
        
    } failure:^(id erro) {
        
        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        
    }];
    
    
}



#pragma mark - 通知
#pragma mark -- 通知-获取我是瀚付通知数据
+ (void)shShowNoticeScreenType:(NSString *)screenType
                       success:(void(^)(HomeNoticeModel *noticeModel))success{
    
    //    UIViewController *vc =  [SHHelper currentViewController];
    //    [MBProgressHUD showHUDAddedTo:vc.view animated:YES];
    if (!screenType) {
        SHLog(@"消息类型为空");
        return;
    }
    NSDictionary *params = @{@"screen_type":screenType};
    [MyDataService requestAFURL: KSH_PAY_NOTICE httpMethod:@"GET" params:params data:nil complection:^(id result) {
        //        [MBProgressHUD hideHUDForView:vc.view animated:YES];
        if ([result[@"success"] isEqualToNumber:@(1)]) {
            HomeNoticeModel  *noticeModel = [HomeNoticeModel mj_objectWithKeyValues:result[@"data"]];
            
            success(noticeModel);
            
        }else{
            //[vc.view makeToast:result[@"data"] duration:2 position:@"center"];
        }
    } failure:^(id erro) {
        //        [MBProgressHUD hideHUDForView:vc.view animated:YES];
    }];
    
    
    
    
}



@end
